﻿{include file="public/header" /}

</head>

<body>
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
		<span class="c-gray en">&gt;</span> 系统管理
		<span class="c-gray en">&gt;</span> 个人资质
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="page-container">
		<div class="form form-horizontal" id="form-article-add">
			<div id="tab-system" class="HuiTab">
				<div class="tabBar cl">
					<a style="color: white;text-decoration:none;" href="{:url('sys/user_shenhe')}"><span>OEM记录</span></a>
					<a style="color: black;text-decoration:none;" href="{:url('sys/memuser_shenhe')}"><span>会员记录</span></a>
				</div>

				<div class="tabCon">
					<table class="table table-border table-bordered table-bg">
					<thead>
						<tr class="text-c">						
							<th>类型</th>
							<th>开户人姓名</th>
							<th>手机号</th>
							<th>状态</th>
							<th>增加时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						{volist name="list" id="vo" empty="这里没有数据"}
						<tr class="text-c">
							<td>
							{switch name="$vo.user_type"}
							    {case value="2"}OEM{/case}
							    {case value="3"}省代{/case}
							    {case value="4"}市代{/case}
							    {default /}市代
							{/switch}
							</td>
							<td>{$vo.user_name}</td>
							<td>{$vo.mobile}</td>
							<td>
								{if $vo.is_verify==1}
								<span style="color: #5eb95e;">审核通过</span>
								{elseif $vo.is_verify==2}
								<span style="color: red;">待审核</span>
								{else}
								<span style="color: #00a1d6;">已驳回</span>
								{/if}	
							</td>
							<td>{$vo.add_time}</td>
							<td class="td-manage">
								<a title="查看资料" href="{:url('user_examine',['id'=>$vo.id])}"  class="ml-5" style="text-decoration:none">查看资料</a>
								{if $vo.is_verify==2}
								<a title="驳回" href="javascript:;" onclick="agent_reject('驳回原因','{:url('sys/agent_reject',['id'=>$vo.id,'type'=>2])}','400','300')"  class="ml-5" style="text-decoration:none">驳回</a>
								<a title="通过" href="javascript:;" onclick="examine_pass(this,{$vo.id},2,{$vo.user_id})"  class="ml-5" style="text-decoration:none">通过</a>
								{/if}
							</td>
						</tr>
						{/volist}
					</tbody>
					</table>
					<style>
					.pagination li{float: left;}
					</style>
					<div id="pageNav" class="pageNav">{$list->render()}</div>
			</div>
		</div>
	</div>
	{include file="public/footer" /}

	<script type="text/javascript">
		/*审核通过*/
		function examine_pass(obj, id, type, userid) {
			layer.confirm('确认审核通过吗？', {
				btn: ['确定', '取消'] //按钮
			}, function() {
				$.ajax({
					type: 'get',
					url: "{:url('sys/examine_pass')}",
					dataType: 'json',
					data: {
						id: id,
						type: type,
						user_id: userid
					},
					success: function(data) {
						if(data.code == 200) {
							layer.msg(data.msg, {
							  icon: 1,
							  time: 1000 //2秒关闭（如果不配置，默认是3秒）
							}, function(){
								location.href = "{:url('sys/user_shenhe')}";
							});
						} else {
							layer.msg(data.msg, {
								icon: 1,
								time: 1000
							});
						}
					},
					error: function(data) {
						console.log(data.msg);
					}
				});
			});
		}
		
		/*审核驳回跳转*/
		function agent_reject(title, url, w, h) {
			layer_show(title, url, w, h);
		}
		
		$(function() {
			$('.skin-minimal input').iCheck({
				checkboxClass: 'icheckbox-blue',
				radioClass: 'iradio-blue',
				increaseArea: '20%'
			});
			$("#tab-system").Huitab({
				index: 0
			});
		});
	</script>